#include "MainHeader.h"

sCombo::~sCombo()
{
   Clear();
}
sCombo::sCombo()
{
   cClear();
}

int             sCombo::Init(HWND sComboHwnd)
{
   hCombo = sComboHwnd;
   Clear();
   return 0;
}
int             sCombo::Disable()
{
   EnableWindow(hCombo, 0);
   return 0;
}
int             sCombo::Enable()
{
   EnableWindow(hCombo, 1);
   return 0;
}
int             sCombo::cClear()
{
   hCombo = NULL;
   return 0;
}
int             sCombo::Clear()
{
   SendMessage(hCombo, CB_RESETCONTENT, 0, 0);
   return 0;
}
long            sCombo::GetListIndex()
{
   return SendMessage(hCombo, CB_GETCURSEL, 0, 0);
}

int             sCombo::SetListIndex(int Value)
{
   SendMessage(hCombo, CB_SETCURSEL, Value, 0);
   return 0;
}
int             sCombo::sList(int index)
{
   SendMessage(hCombo, CB_GETITEMDATA, index, 0);
   return 0;
}
int             sCombo::Click()
{
   return 0;
}

int             sCombo::Additem(char *string)
{
   SendMessage(hCombo, CB_ADDSTRING, 0, (long) string);
   return 0;
}

HWND            sCombo::thishwnd()
{
   return hCombo;
}

Scroller::Scroller()
{
   ;
}

Scroller::~Scroller()
{
   ;
}
sChecks::~sChecks()
{
   cClear();
}
sChecks::sChecks()
{
   cClear();
}

int             sChecks::cClear()
{
   check = NULL;
   return 0;
}

int             sChecks::SetCnt(HWND hwnd)
{
   check = hwnd;
   return 0;
}

int             sChecks::value()
{

   return SendMessage(check, BM_GETCHECK, 0, 0);
}

int             sChecks::value(u8 Val)
{
   if (Val < 3)
   {
      SendMessage(check, BM_SETCHECK, Val, 0);
   } else
   {
      //sMessage("Bad checkbox value");
   }
   return 0;
}

int             sChecks::State(bool flag)
{
   EnableWindow(check, flag);
   return 0;
}

int             sChecks::State()
{

   return IsWindowEnabled(check);
}

int             stxts::SetHwnd(HWND hwnd)
{
   thisHwnd = hwnd;
   return 0;
}
int             stxts::GetText()
{

   int             val = 0;
   char            buf[100];

   GetWindowText(thisHwnd, buf, 4);
   sscanf(buf, "%d", &val);
   return val;
}

int             stxts::SetText(char *string)
{
   SetWindowText(thisHwnd, string);
   return 0;
}

int             DrawTileRect(HDC hdc, MousePointer mpointer, int mul)
{
   RECT            myrect;
   HBRUSH          curbrush = CreateSolidBrush(RGB(255, 0, 0));

   myrect.left = mpointer.sX * mul;
   myrect.top = mpointer.sY * mul;
   myrect.right = mpointer.Width * mul + myrect.left;
   myrect.bottom = myrect.top + mpointer.Height * mul;
   FrameRect(hdc, &myrect, curbrush);
   DeleteObject(curbrush);
   return 0;
}



sList::~sList()
{
   Clear();
}
sList::sList()
{
   cClear();
}

int             sList::Init(HWND sListHwnd)
{
   hCombo = sListHwnd;
   Clear();
   return 0;
}
int             sList::Disable()
{
   EnableWindow(hCombo, 0);
   return 0;
}
int             sList::Enable()
{
   EnableWindow(hCombo, 1);
   return 0;
}
int             sList::cClear()
{
   hCombo = NULL;
   return 0;
}
int             sList::Clear()
{
   SendMessage(hCombo, LB_RESETCONTENT, 0, 0);
   return 0;
}
long            sList::GetListIndex()
{
   return SendMessage(hCombo, LB_GETCURSEL, 0, 0);
}

int             sList::SetListIndex(int Value)
{
   SendMessage(hCombo, LB_SETCURSEL, Value, 0);
   return 0;
}
int             sList::sListStrings(int index)
{
   SendMessage(hCombo, LB_GETITEMDATA, index, 0);
   return 0;
}

int             sList::Additem(char *string)
{
   SendMessage(hCombo, LB_ADDSTRING, 0, (long) string);
   return 0;
}

HWND            sList::thishwnd()
{
   return hCombo;
}



nRoomBuff::nRoomBuff()
{

}
nRoomBuff::~nRoomBuff()
{

}